﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Masood.MobileGames.SlidingLib.Enum;

namespace Masood.MobileGames.Sliding
{
    public partial class Custom : PhoneApplicationPage
    {
        public Custom()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            int noOfCols = 0;
            int noOfRows = 0;
            if (!string.IsNullOrEmpty(txtNoOfCols.Text))
                noOfCols = Convert.ToInt32(txtNoOfCols.Text);

            if (noOfCols <= 1 || noOfCols > 6)
            {
                MessageBox.Show("2 to 6 cols supported.");
                return;
            }

            if (!string.IsNullOrEmpty(txtNoOfRows.Text))
                noOfRows = Convert.ToInt32(txtNoOfRows.Text);

            if (noOfRows <= 2 || noOfRows > 10)
            {
                MessageBox.Show("3 to 10 rows supported.");
                return;
            }

            App.NoOfRows = noOfRows;
            App.NoOfCols = noOfCols;

            //App.GameLevel = GameEnum.Custom;
            NavigationService.Navigate(new Uri("/GamePage.xaml", UriKind.Relative));
        }
    }
}